#include "tree.h"
bitree* bitreecreat(int n, datatype i)
{
    bitree * root = (bitree *)malloc(sizeof(bitree));
    if(root == NULL)
    {
        printf("error!");
        return NULL;
    }
    root->data = i;
    if(2*i<=n)
    {
        root->lchild = bitreecreat( n, 2*i);
    }
    else{
          root->lchild = NULL;
    }
    if(2*i+1<=n)
    {
        root->rchild =  bitreecreat( n, 2*i+1);
    }
    else{
        root->rchild = NULL;
    }
    return root;

}